<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>

    <!-- Admin can see this -->
    <el-tag v-permission="['admin']">admin</el-tag>

    <!-- Editor can see this -->
    <el-tag v-permission="['editor']">editor</el-tag>

    <!-- Editor can see this -->
    <el-tag v-permission="['admin','editor']">Both admin or editor can see this</el-tag>

  </div>
</template>

<script>
import permission from '@/directive/permission/index.js' // 权限判断指令
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  directives: { permission },
  computed: {
    ...mapGetters([
      'name'
    ])
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
